#ifndef WORLD_H
#define WORLD_H

#include <SFML/Graphics.hpp>
#include <iostream>
#include <string>
#include "Pnj.h"
#include "var_define.h"
#include <stdio.h>
#include "Map.h"
#include "time.h"
#include <pthread.h>
#include "Fighter.h"
#include "FichierDial.h"
#include <vector>
#include "NameList.h"
#include "Fight.h"
#include "Screen.h"


class GameMenu;
class Save;

using namespace std;
using namespace sf;

class World
{
    public:
        World(bool n = true);
        ~World();
        void setScreen(Screen* s);
        void reloadScreen(Screen* s);
        int main();

        enum scenario{begin, inter1, inter2, inter3, inter4, inter5, final};
        void reloadWorld(string filename);
        void save(int nb);
        string getInfosSave(string file);


    private:
        Fighter perso;
        //vector<Pnj> listePnj;
        //int nbPnj;
        Map* map;
        Screen* screen;
        View view;
        Event event;
        FichierDial dial;
        fstream fichierToLoad;
        float taux;
        NameList* nameList;
        Fight fight;
        GameMenu* mainMenu;
        scenario scenarion_en_cours;

        string scenario_str[7];

    private :
        void searchInteraction();
        void dialogue(int i);
        bool rencontre();
        void drawcombat(); // Cette fonction devra fermer la fenetre de map, pour ouvrir une fenetre de combat.
        void movePnj();
        void loadFighter();
        void loadPnj(Pnj& p);
        void readInventaire();




};

#endif // WORLD_H
